//
//  XBContact.m
//  FindPreciousFrameWork
//
//  Created by GK on 16/4/7.
//  Copyright © 2016年 MoreMoney. All rights reserved.
//

#import "XBContact.h"

@implementation XBContact

- (instancetype) initWithDict:(NSDictionary *)dict
{
    if(self = [super init])
    [self setValuesForKeysWithDictionary:dict];
    return self;
}
+ (instancetype)contactWithDict:(NSDictionary *)dict
{
    return [[self alloc]initWithDict:dict];
}



+ (NSArray *)contact
{
    NSBundle *bundle = [NSBundle mainBundle];
    NSString *filePath = [bundle pathForResource:@"contacts.plist" ofType:nil];
    NSArray *arrDict = [NSArray arrayWithContentsOfFile:filePath];
    
    NSMutableArray *arrModel = [NSMutableArray array];
    for (NSDictionary *dict in arrDict)
    {
        XBContact *contact = [XBContact contactWithDict:dict];
        [arrModel addObject:contact];
    }
    return arrModel;
}




@end
